# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# Tests for LLVM libc stdio.h functions.

load("//libc/test:libc_test_rules.bzl", "libc_test")

package(default_visibility = ["//visibility:public"])

licenses(["notice"])

libc_test(
    name = "printf_parser_test",
    srcs = ["printf_core/parser_test.cpp"],
    libc_function_deps = [
    ],
    deps = [
      "//libc:printf_parser",
      "//libc:printf_core_structs",
      "//libc:__support_cpp_string_view",
      "//libc:__support_cpp_bit",
      "//libc:__support_arg_list",
      "//libc/utils/testutils:libc_test_utils",
      "//libc/test/UnitTest:printf_matcher",
    ],
)

libc_test(
    name = "printf_string_writer_test",
    srcs = ["printf_core/string_writer_test.cpp"],
    libc_function_deps = [
    ],
    deps = [
      "//libc:printf_string_writer",
      "//libc:printf_writer",
      "//libc:printf_core_structs",
      "//libc:__support_cpp_string_view",
      "//libc:__support_arg_list",
    ],
)

libc_test(
    name = "printf_converter_test",
    srcs = ["printf_core/converter_test.cpp"],
    libc_function_deps = [
    ],
    deps = [
      "//libc:printf_converter",
      "//libc:printf_string_writer",
      "//libc:printf_writer",
      "//libc:printf_core_structs",
      "//libc:__support_cpp_string_view",
      "//libc:__support_arg_list",
    ],
)

libc_test(
    name = "sprintf_test",
    srcs = ["sprintf_test.cpp"],
    libc_function_deps = [
        "//libc:sprintf",
    ],
    deps = [
      "//libc:__support_fputil_fp_bits",
      "//libc:__support_fputil_platform_defs",
      "//libc/utils/testutils:libc_test_utils",
    ],
)

libc_test(
    name = "snprintf_test",
    srcs = ["snprintf_test.cpp"],
    libc_function_deps = [
        "//libc:snprintf",
    ],
)
